package mianxiangduixiang.Test4.Exam2;

import java.util.Random;

public class Test {
    public static void main(String[] args) {
        int rand = new Random().nextInt(9);
        if (rand % 2 == 0) {
            Circle circle = new Circle(5.20);
            System.out.println("Circle Area:" + String.format("%.2f", circle.getArea()) + " Perimeter:" + String.format("%.2f", circle.getPerimeter()));
        } else {
            Square square = new Square(3.20, 2.20);
            System.out.println("Square Area:" + String.format("%.2f", square.getArea()) + " Perimeter:" + String.format("%.2f", square.getPerimeter()));
        }
    }
}
